[ Mega Script Archive ] [ Readme's ] [ SSI Random Image Displayer ]


Copyright and Header


##############################################################################
# SSI Random Image Displayer    Version 1.2                                  # 
# Copyright 1996 Matt Wright    mattw@worldwidemart.com                      #
# Created 7/1/95                Last Modified 11/4/95                        #
# Scripts Archive at:           http://www.worldwidemart.com/scripts/        #
##############################################################################
# If you run into any problems while trying to configure this scripts, help  #
# is available.  The steps you should take to get the fastest results, are:  #
#       1) Read this file thoroughly                                         #
#       2) Consult the Matt's Script Archive Frequently Asked Questions:     #
#               http://www.worldwidemart.com/scripts/faq/                    #
#       3) If you are still having difficulty installing this script, send   #
#          e-mail to: scripts-help@tahoenet.com                              #
#          Include any error messages you are receiving and as much detail   # 
#          as you can so we can spot your problem.  Also include the variable#
#          configuration block that is located at the top of the script.     #
#                                                                            #
# Hopefully we will be able to help you solve your problems.  Thank you.     #
##############################################################################
# COPYRIGHT NOTICE                                                           #
# Copyright 1996 Matthew M. Wright  All Rights Reserved.                     #
#                                                                            #
# SSI Random Image may be used and modified free of charge by anyone so      #
# long as this copyright notice and the comments above remain intact.  By    #
# using this this code you agree to indemnify Matthew M. Wright from any     #
# liability that might arise from it's use.                                  #  
#                                                                            #
# Selling the code for this program without prior written consent is         #
# expressly forbidden.  In other words, please ask first before you try and  #
# make money off of my program.                                              #
#                                                                            #
# Obtain permission before redistributing this software over the Internet or #
# in any other medium.  In all cases copyright and header must remain intact.#
##############################################################################

Overview

  • This script is provided to allow you to have a random image appear on your page every time it is reloaded. The server side includes version offers you link flexibility as well as coinciding random alt text and other variables which make it slightly more advanced than the Basic Random Image Displayer.

    There are two files included with this script.

    1. README - This file, which explains installation
    2. ssi_rand_image.pl - The perl script which chooses the random image.

ssi_rand_image.pl

  • Below is a list of the changes that must be made to the ssi_rand_image.pl file in order for it to choose your random images correctly:

    Inside the script you will see a list of variables, which must be defined in order for your script to work. Below is a description of how to define each one:

    Necessary Variables

    Options

    • There are also a number of options that you will need to define and decide whether to use. They are located directly below the variables in the ssi_rand_image.pl script.
      $uselog = "1";
      At this point you must decide whether or not you want to use the logging feature. for most practical purposes this will not be used, but some people may find it helpful either for keeping stats or seeing which images get picked the most. All the logging feature will record is the image, date, and remote host that saw the image. Should you choose to turn this option on, you will need to define two more variables:
      $logfile = "/home/mattw/public_html/links/ssi_image";
      The location of the log file. This must be in a readable/writable directory and given read/write permissions for all users so that the server's uid may edit the log file.
      $date = `/usr/bin/date`; chop($date);
      This is the location of your date function enclosed in '`' so that it will be executed when it is called upon. It returns the date function for logging purposes only.


      $link_image = "1";
      If you turn this variable off you do not need to worry about what is in the @urls variable. It simply won't link any of your images.
      $align = "left";
      This is the way in which you want your image aligned. Valid choices for Netscape include: left, right, middle, absmiddle, bottom, and absbottom.
      $border = "2";
      This is the size you want your border to be. Mainly occurs when you have images linked the border turns blue, and in Netscape you can control the size. Setting this to zero causes there to be no border.

      You can turn off both align and border by setting them equal to "" like: $align = ""; or $border = "";


Server Side Includes

  • I hope that you already know how to accomplish a Server Side Includes, and therefore I am not going to go into detail about how. Two things you can check for are:
    1. Ask your sysadmin if you have access to server side includes and what you need to change about your file to make them work. This often involves changing your .html files to .shtml.
    2. If you really don't know anything about Server Side Includes, you can check out a great tutorial that NCSA has developed; located at:
             http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html

History

  Version 1.1:  09/30/95  - Corrections made to random image displayer to 
                            add functionality of alt text, links, etc... 
                            to each random image..
  Version 1.2:  11/04/95  - Errors in alt="" tag not being noticed 
                            correctly, and spacing being messed up fixed!

[ Mega Script Archive ]